#sing SetLocal EnableDelayedExpansion
#newl set extractedImage=#path#name-imageex-|
#newl "D:\apps\gs\bin\gswin32c.exe" |--convert pdf to tiff--
-r2400 |-r300 |--resolution. Higher resolution is used with downscalling.--
#remark PDF pages to process. Default setting is to process all pages|-dFirstPage=1 -dLastPage=3 |--Choose first and last page.--
-dTextAlphaBits=4 -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -dDownScaleFactor=8 -sDEVICE=tiffscaled8  -o "%extractedImage%%%03d.tif"   "#item" |--more settings--
#newl echo {\rtf1}>"#path-1st.rtf"|
#newl FOR %%a in ("%extractedImage%*.*") do (
#newl "#ppthapps\Puma.NET\cuneiform-clvb\cuneiform-clvb.exe" |-program file-
-LoadImage="%%a" |-input-
-FileFormat=RtfAnsi    -RecognizeToFileName="%%a.rtf" |
#remark enable spellcheck, default on|-EnableSpeller=false |
-Language=Croatian |-Language=Serbian |-Language=English |-Language=Russian |
-RecognizePictures=false |-RecognizePictures=true |--remark recognize pictures, on by default--
-DetectBold=false |-DetectBold=true |-detect bold, default on(true)-
-DetectItalic=false |-DetectItalic=true |-detect italic, default on(true)-
-DetectSize=false |-DetectSize=true |-detect font size, default on(true)-
#newl "#ppthapps\rtfappend-clvb\rtfappend-clvb" |-append rtf files-
-stFileIn1="#path-1st.rtf" |-1temp-
-stFileIn2="%%a.rtf" |-1 real-
-stFileOut="#path-all.rtf" |-file out-
-boUseCustomRtfControl=true |-use custom rtf control, original has some issues with rtf tables, default off. Recomended on.-
-boUseCustomFontOnAllPages=true |-change font in all pages to a single one-
-stFontFamily="Times New Roman" -siFontSize=12 |-stFontFamily="Arial" -siFontSize=12 |
#newl copy "#path-all.rtf" "#path-1st.rtf" |
#newl del "%%a.rtf" |-cleaning-
#newl del "%%a" |-cleaning-
#newl )
#newl del "#path-all.rtf" |-cleaning, it gets overwritten anyway always, so just delete it after the last file is done-
#newl copy "#path-1st.rtf" "#path#name-cu-rtf.rtf" |
#newl del "#path-1st.rtf" |-cleaning, final-


<comment>
Convert multiple images to text using OCR (Optical character recognition).
Uses cuneiform ocr.
If you change file format, change recognize_to_filename too.
(TXT format only)
If using with Cyrillic, change language to Serbian.
Libre Office has some problems writing tables in rtf? Use Wps2014 office if editing rtf.